from pydantic import BaseModel, EmailStr, Field


class UserCreateSchema(BaseModel):
    email: EmailStr
    password: str = Field(..., min_length=8, max_length=24, description='密码最小长度为8,最大长度为24个字符')


class UserLoginSchema(UserCreateSchema):
    pass


class UserResponseSchema(BaseModel):
    email: EmailStr


class TokenSchema(BaseModel):
    access_token: str
    token_type: str


class ErrorSchema(BaseModel):
    detail: str
